package com;

import java.util.ArrayList;

public class TestString {
	public static void main(String args[]){
		String filter = "gogogo0778f888";
		String gogogo = filter.replaceAll(".*[^\\d](?=(\\d+))","");
		System.out.println(gogogo);

		System.out.println(verifycfbh("abc01230db12"));
	}

	public static String verifycfbh(String str){

		String mLastValue = String.valueOf(str.charAt(str.length()-1));

		//过滤掉字母部分
		String mNumValue = str.replaceAll(".*[^\\d](?=(\\d+))","");

		//如果是多位数字判断第一位是不是0
		if(mNumValue.length()>1){
			String mFirstValue = String.valueOf(mNumValue.charAt(0));
			if(mFirstValue.equals("0")){
				return mNumValue.substring(1,mNumValue.length());
			}
		}
		return mNumValue;
	}
}
